]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Disconnect content-updated signal early
authorGiovanni Campagna <gcampagna@src.gnome.org>
Mon, 28 Jan 2013 11:01:36 +0000 (12:01 +0100)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Mon, 28 Jan 2013 20:02:45 +0000 (21:02 +0100)
During the box pointer animation, other events can trigger an updateState,
losing the information that the summary is hiding and thus never disconnecting
the signals. Then, this stale connections can cause stacktraces, as they
fire when summaryBoxPointerItem is null.

https://bugzilla.gnome.org/show_bug.cgi?id=692693

js/ui/messageTray.js

index 861f32588f06d282b8a2cddd733bc4a7ac6e4b94..277b7e30bf2ce32f361595e7602f01b693c915a3 100644 (file)
@@ -2613,6 +2613,20 @@ const MessageTray = new Lang.Class({
 
     _onSummaryBoxPointerUngrabbed: function() {
         this._summaryBoxPointerState = State.HIDING;
+
+        if (this._summaryBoxPointerContentUpdatedId) {
+            this._summaryBoxPointerItem.disconnect(this._summaryBoxPointerContentUpdatedId);
+            this._summaryBoxPointerContentUpdatedId = 0;
+        }
+        if (this._summaryBoxPointerCloseClickedId != 0) {
+            this._summaryBoxPointerItem.closeButton.disconnect(this._summaryBoxPointerCloseClickedId);
+            this._summaryBoxPointerCloseClickedId = 0;
+        }
+        if (this._sourceDoneDisplayingId) {
+            this._summaryBoxPointerItem.source.disconnect(this._sourceDoneDisplayingId);
+            this._sourceDoneDisplayingId = 0;
+        }
+
         this._unlock();
 
         if (this._summaryBoxPointerItem.source.notifications.length == 0) {
@@ -2635,14 +2649,6 @@ const MessageTray = new Lang.Class({
 
         this._summaryBoxPointerState = State.HIDDEN;
         this._summaryBoxPointer.bin.child = null;
-        this._summaryBoxPointerItem.disconnect(this._summaryBoxPointerContentUpdatedId);
-        this._summaryBoxPointerContentUpdatedId = 0;
-        if (this._summaryBoxPointerCloseClickedId != 0) {
-            this._summaryBoxPointerItem.closeButton.disconnect(this._summaryBoxPointerCloseClickedId);
-            this._summaryBoxPointerCloseClickedId = 0;
-        }
-        this._summaryBoxPointerItem.source.disconnect(this._sourceDoneDisplayingId);
-        this._summaryBoxPointerDoneDisplayingId = 0;
 
         let sourceNotificationStackDoneShowing = null;
         if (doneShowingNotificationStack) {